<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%@page import="com.lmpop.trade.tb_commpara.Tb_commparaInfo" %> 
<%@page import="com.lmpop.trade.ti_srcgoods.*" %>
<jsp:useBean id="randomId" class="com.lmpop.frame.util.RandomID" scope="page" />
<%
    
	String src_id="";
  	if(request.getParameter("src_id")!=null) src_id = request.getParameter("src_id");
  	Ti_srcgoodsInfo ti_srcgoodsInfo = new Ti_srcgoodsInfo();
  	List list = ti_srcgoodsInfo.getListByPk(src_id);
  	Hashtable map = new Hashtable();
  	if(list!=null && list.size()>0) map = (Hashtable)list.get(0);
  	
  	String cust_id="",state_code="",goods_name="",goods_type="",s_send_type="",weight="",volume="";
	String goods_value="",price="",name="",start_addr="",phone="",cellphone="",msn="",qq="",email="";
	String end_addr="",is_pay="",is_back_order="",send_time="",insure_price="",s_pay_type="",pack="";
	String end_date="",in_date="",user_id="",remark="";
  	if(map.get("cust_id")!=null) cust_id = map.get("cust_id").toString();
  	if(map.get("state_code")!=null) state_code = map.get("state_code").toString();
  	if(map.get("goods_name")!=null) goods_name = map.get("goods_name").toString();
  	if(map.get("goods_type")!=null) goods_type = map.get("goods_type").toString();
  	if(map.get("send_type")!=null) s_send_type = map.get("send_type").toString();
  	if(map.get("weight")!=null) weight = map.get("weight").toString();
  	if(map.get("volume")!=null) volume = map.get("volume").toString();
  	if(map.get("goods_value")!=null) goods_value = map.get("goods_value").toString();
  	if(map.get("price")!=null) price = map.get("price").toString();
  	if(map.get("name")!=null) name = map.get("name").toString();
  	if(map.get("start_addr")!=null) start_addr = map.get("start_addr").toString();
  	if(map.get("phone")!=null) phone = map.get("phone").toString();
  	if(map.get("cellphone")!=null) cellphone = map.get("cellphone").toString();
  	if(map.get("msn")!=null) msn = map.get("msn").toString();
  	if(map.get("qq")!=null) qq = map.get("qq").toString();
  	if(map.get("email")!=null) email = map.get("email").toString();
  	if(map.get("end_addr")!=null) end_addr = map.get("end_addr").toString();
  	if(map.get("is_pay")!=null) is_pay = map.get("is_pay").toString();
  	if(map.get("is_back_order")!=null) is_back_order = map.get("is_back_order").toString();
  	if(map.get("send_time")!=null) send_time = map.get("send_time").toString();
  	if(map.get("insure_price")!=null) insure_price = map.get("insure_price").toString();
  	if(map.get("pay_type")!=null) s_pay_type = map.get("pay_type").toString();
  	if(map.get("pack")!=null) pack = map.get("pack").toString();
  	if(map.get("end_date")!=null) end_date = map.get("end_date").toString();
  	if(map.get("in_date")!=null) in_date = map.get("in_date").toString();
  	if(map.get("user_id")!=null) user_id = map.get("user_id").toString();
  	if(map.get("remark")!=null) remark = map.get("remark").toString();
	if(end_date.length()>10){
	   end_date = end_date.substring(0,10);
	}
	
	Tb_commparaInfo tb_commparaInfo = new Tb_commparaInfo(); 
	//String goods_type = tb_commparaInfo.getSelectItem("55",s_goods_type);  
	String send_type = tb_commparaInfo.getSelectItem("63",s_send_type);
	String pay_type = tb_commparaInfo.getSelectItem("64",s_pay_type);
	String checkBoxString = tb_commparaInfo.getCheckBoxString("68","g_type","para_code2","para_code1",goods_type);
%>


<html>
<head>
    <title>修改货源</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script language="javascript" type="text/javascript" src="/program/plugins/calendar/WdatePicker.js"></script>
	<script src="js_srcgoods.js"></script>
</head>

<body>
	<h1>修改货源</h1>
	<form action="/doTradeReg.do" method="post" name="addForm">
	 
	 <table width="100%" cellpadding="0" cellspacing="1" border="0" class="listtab">
		
		
		<tr>
		 <td  colspan="4">
			   &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">货源基本信息</span></td>
	    </tr>
		
		
		<tr>
			<td align="right" width="20%">
				物品名称<font color="red">*</font>
			</td>
			
			<td  colspan="3">
			  <input name="goods_name" id="goods_name" type="text" size="60" maxlength ="100" value="<%=goods_name%>"/>
		    </td>
		</tr>
		
		<tr>
			<td align="right" width="20%">
				货物类型<font color="red">*</font>
			</td>
			
			<td  colspan="3">
			
			 <%=checkBoxString%>
			 
			 
			</td>
		</tr>
		
		<tr>
			<td align="right" width="20%">
				运输方式<font color="red">*</font>
			</td>
			
			<td  colspan="3">
			  <select name="send_type" id="send_type">
				   <option value="">请选择...</option>
				   <%=send_type%>
			   </select>
		    </td>
		</tr>
		
		<tr>
			<td align="right" width="20%">
				重量:
			</td>
			<td  width="18%">
			  <input name="weight" id="weight" type="text" size="6" maxlength="10" value="<%=weight%>" /> &nbsp;(单位:千克)
			</td>
			<td width="12%" align="right">体积:</td>
			<td width="60%">
			   <input name="volume" id="volume" type="text" maxlength="40"  value="<%=volume%>" /> &nbsp;(长cm×宽cm×高cm)
			</td>
		</tr>
		
		
		<tr>
			<td align="right" width="20%">
				货物价值:
			</td>
			<td  width="18%">
			 <input name="goods_value" id="goods_value" type="text" maxlength="100"  value="<%=goods_value%>" />
			</td>
			<td width="12%" align="right">参考运价:</td>
			<td width="60%">
			   <input name="price" id="price" type="text" maxlength="10"  value="<%=price%>"  onKeyUp="if(isNaN(value))this.value=''"  /> &nbsp;(元-/吨/立方/公斤/车)
			</td>
		</tr>
		
		<tr>
		<td  colspan="4">
			   &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">发件人信息</span></td>
	    </tr>
		
		
		
		<tr>
			<td align="right" width="20%">
				姓名<font color="red">*</font>
			</td>
			<td  width="18%">
			  <input name="name" id="name" type="text"  maxlength="10" value="<%=name%>" />
			</td>
			<td width="12%" align="right">始发地:</td>
			<td width="60%">
			   <input name="start_addr" id="start_addr" type="text"  maxlength="60"  value="<%=start_addr%>"  />
			</td>
		</tr>
		
		<tr>
			<td align="right" width="20%">
				电话:
			</td>
			<td  width="18%">
			   <input name="phone" id="phone" type="text" maxlength="20"  value="<%=phone%>" />
			</td>
			<td width="12%" align="right">手机<font color="red">*</font></td>
			<td width="60%">
			   <input name="cellphone" id="cellphone" type="text" maxlength="20"  value="<%=cellphone%>"  />
			</td>
		</tr>
		
		<tr>
			<td align="right" width="20%">
				msn:
			</td>
			<td  width="18%">
			   <input name="msn" id="msn" type="text"  maxlength="60"  value="<%=msn%>"  />
			</td>
			<td width="12%" align="right">qq:</td>
			<td width="60%">
			   <input name="qq" id="qq" type="text"  maxlength="20"  value="<%=qq%>"  />
			</td>
		</tr>
		
		
		<tr>
			<td align="right" width="20%">
				email:
			</td>
			<td  width="18%">
			   <input name="email" id="email" type="text"  maxlength="60"  value="<%=email%>"  />
			</td>
			<td width="12%" align="right">收件人目的地:</td>
			<td width="60%">
			  <input name="end_addr" id="end_addr" type="text" maxlength="100"  value="<%=end_addr%>"   />
			</td>
		</tr>
		
		<tr>
		<td  colspan="4">
			   &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">附件信息</span></td>
	    </tr>
		
		
		
		
		<tr>
			<td align="right" width="20%">
				是否代收货款:
			</td>
			<td  width="18%">
			 <input type="radio" name="is_pay" id="is_pay1" value="0"  <%if(is_pay.equals("0"))out.print("checked");%> /> 是
			 <input type="radio" name="is_pay" id="is_pay2" value="1" <%if(is_pay.equals("1"))out.print("checked");%> /> 否
			</td>
			<td width="12%" align="right">是否签回单:</td>
			<td width="60%">
			   
			   <input type="radio" name="is_back_order" id="is_back_order1" value="0" <%if(is_back_order.equals("0"))out.print("checked");%>  /> 是
			   <input type="radio" name="is_back_order" id="is_back_order2" value="1" <%if(is_back_order.equals("1"))out.print("checked");%> /> 否
			</td>
		</tr>
		
		<tr>
			<td align="right" width="20%">
				指定时间派送:
			</td>
			<td  width="18%">
			  <input name="send_time" id="send_time" type="text" maxlength="20" value="<%=send_time%>"/>
			</td>
			<td width="12%" align="right">保价<font color="red">*</font></td>
			<td width="60%">
			    <input name="insure_price" id="insure_price" type="text" maxlength="10"  value="<%=insure_price%>" onKeyUp="if(isNaN(value))this.value=''" /> &nbsp;(元)
			</td>
		</tr>
		
		<tr>
			<td align="right" width="20%">
				付费方式:
			</td>
			<td  width="18%">
			
			  <select name="pay_type" id="pay_type">
				   <option value="">请选择...</option>
				   <%=pay_type%>
			   </select>
			
			</td>
			<td width="12%" align="right">包装要求:</td>
			<td width="60%">
			    <input name="pack" id="pack" type="text" maxlength="100"  value="<%=pack%>"  />
			</td>
		</tr>
		
		<tr>
		<td align="right" width="20%">
			信息有效期		
		</td>
		<td colspan="3">
            
			<span id="end_b" style="display:inline">
			<%=end_date%>
			&nbsp; &nbsp;<input type="button" class="button_s_css" value="重新设定"  onclick="setEnd()" />
			</span>

			<span id="end_a" style="display:none">
				<input type="radio" name="s_end_date" id="end_date1" value="10" />10天
				<input type="radio" name="s_end_date" id="end_date2" value="20" />20天
				<input type="radio" name="s_end_date" id="end_date3" value="30" checked />1个月	
				<input type="radio" name="s_end_date" id="end_date4" value="90" />3个月	
				<input type="radio" name="s_end_date" id="end_date5" value="180" />6个月
			</span>
			<input type="hidden" name="g_type_flag" id="g_type_flag" value="0" />
		</td>
	</tr>
		
	</table>
	<script>
	 function setEnd(){
	     document.getElementById('end_b').style.display ='none';
		 document.getElementById('end_a').style.display ='inline';
	     document.getElementById('g_type_flag').value =1;
	 }
	
	</script>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" name="bpm_id" value="7754" />
				<input type="hidden" name="goods_type" id="goods_type" value="" />
				<input type="hidden" name="end_date" value="<%=end_date%>" />
				<input type="hidden" name="src_id" value="<%=src_id%>" />
				<input type="hidden" name="cust_id" value="<%=cust_id%>" />
				<input type="hidden" name="state_code" value="<%=state_code%>" />
				<input type="hidden" name="user_id" id="user_id" value="<%=user_id%>" />
				<input type="button" class="buttoncss" name="tradeSub" value="提交"  onclick="subForm()" />&nbsp;&nbsp;
				<input type="button" class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='index.jsp';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
